{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2.1.3 文本嵌入模型 (Text Embedding Models)\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 安装和设置密钥"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%pip install openai langchain"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 安装和设置密钥"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.012008527293801308,\n",
       " -0.001835253438912332,\n",
       " 0.00145026296377182,\n",
       " -0.0030227703973650932,\n",
       " -0.005661344155669212,\n",
       " 0.005086636636406183,\n",
       " -0.024550484493374825,\n",
       " -0.0012430825736373663,\n",
       " 0.012859474867582321,\n",
       " -0.03881338983774185,\n",
       " 0.0046262359246611595,\n",
       " 0.021337203681468964,\n",
       " -0.020435452461242676,\n",
       " 0.008992106653749943,\n",
       " -0.011811666190624237,\n",
       " 0.02291209250688553,\n",
       " 0.025541139766573906,\n",
       " -0.013348452746868134,\n",
       " 0.013030934147536755,\n",
       " -0.011259185150265694,\n",
       " -0.03647645562887192,\n",
       " 0.007048897445201874,\n",
       " 0.014478816650807858,\n",
       " 0.004889775533229113,\n",
       " 0.005439081694930792,\n",
       " 0.011945023201406002,\n",
       " 0.010655900463461876,\n",
       " -0.016231514513492584,\n",
       " 0.03271704539656639,\n",
       " -0.005026308353990316,\n",
       " 0.017323777079582214,\n",
       " -0.014745531603693962,\n",
       " -0.00810305681079626,\n",
       " 0.0014105732552707195,\n",
       " -0.01037648506462574,\n",
       " -0.015139253810048103,\n",
       " -0.008052254095673561,\n",
       " -0.022404063493013382,\n",
       " 0.0030513470992445946,\n",
       " -0.018543045967817307,\n",
       " 0.02254377119243145,\n",
       " 0.009246121160686016,\n",
       " -0.022124648094177246,\n",
       " 0.006013789214193821,\n",
       " -0.018555745482444763,\n",
       " 0.00896670576184988,\n",
       " -0.020371949300169945,\n",
       " -0.013056335970759392,\n",
       " -0.005073936190456152,\n",
       " 0.012668964453041553,\n",
       " -0.002994193695485592,\n",
       " -0.010033565573394299,\n",
       " -0.02801777981221676,\n",
       " -0.004207112360745668,\n",
       " -0.02215004898607731,\n",
       " -0.008407874032855034,\n",
       " -0.009436631575226784,\n",
       " 0.010605097748339176,\n",
       " -0.004772293847054243,\n",
       " 0.0001626286975806579,\n",
       " -0.014707429334521294,\n",
       " 0.010713053867220879,\n",
       " -0.013170642778277397,\n",
       " -0.005286673083901405,\n",
       " 0.0064202118664979935,\n",
       " 0.006277328822761774,\n",
       " -0.008852398954331875,\n",
       " -0.0015947336796671152,\n",
       " 0.0116338562220335,\n",
       " 0.017057061195373535,\n",
       " 0.03388550877571106,\n",
       " 0.00810305681079626,\n",
       " 0.016891952604055405,\n",
       " 0.027128729969263077,\n",
       " -0.00224167644046247,\n",
       " 0.017158666625618935,\n",
       " -0.04610360041260719,\n",
       " -0.009442982263863087,\n",
       " 0.01706976257264614,\n",
       " -0.00654721911996603,\n",
       " 0.013335751369595528,\n",
       " -0.023293113335967064,\n",
       " 0.0025083913933485746,\n",
       " 0.019038373604416847,\n",
       " 0.01651092991232872,\n",
       " 0.0019876619335263968,\n",
       " -0.03792433813214302,\n",
       " 0.011386191472411156,\n",
       " -0.006220175419002771,\n",
       " -0.00455955695360899,\n",
       " -0.0029624418821185827,\n",
       " 0.005023133009672165,\n",
       " -0.005724847782403231,\n",
       " 0.007372765801846981,\n",
       " -0.01723487116396427,\n",
       " 0.032336022704839706,\n",
       " 0.021489610895514488,\n",
       " 0.029364055022597313,\n",
       " -0.003660981310531497,\n",
       " -0.02997368946671486,\n",
       " 0.007328313309699297,\n",
       " 0.018149323761463165,\n",
       " -0.024245666339993477,\n",
       " -0.001325637218542397,\n",
       " -0.033961713314056396,\n",
       " -0.002675088355317712,\n",
       " 0.019139979034662247,\n",
       " 0.013170642778277397,\n",
       " 0.031218359246850014,\n",
       " -0.039041999727487564,\n",
       " 0.0020146509632468224,\n",
       " 0.0009795427322387695,\n",
       " 0.015113851986825466,\n",
       " -0.05303819105029106,\n",
       " 0.014974144287407398,\n",
       " -0.004750067833811045,\n",
       " 0.011925972066819668,\n",
       " -0.0071695540100336075,\n",
       " -0.007950647734105587,\n",
       " -0.024525081738829613,\n",
       " 0.029491063207387924,\n",
       " 0.026366686448454857,\n",
       " 0.02380114234983921,\n",
       " -0.028881428763270378,\n",
       " 0.005835978779941797,\n",
       " -0.005982037167996168,\n",
       " -0.01324684638530016,\n",
       " -0.018009616062045097,\n",
       " -0.011697359383106232,\n",
       " -0.015024947002530098,\n",
       " 0.043411046266555786,\n",
       " -0.012021227739751339,\n",
       " 0.014618524350225925,\n",
       " 0.01886056363582611,\n",
       " -0.008807946927845478,\n",
       " 0.018924066796898842,\n",
       " -0.028602011501789093,\n",
       " 0.04023586958646774,\n",
       " 0.007639480754733086,\n",
       " -0.008064954541623592,\n",
       " 0.018822461366653442,\n",
       " 0.020778371021151543,\n",
       " -0.016828449442982674,\n",
       " 0.006852036342024803,\n",
       " -0.013907283544540405,\n",
       " 0.02964347042143345,\n",
       " 0.02725573629140854,\n",
       " 0.01889866590499878,\n",
       " -0.008617435581982136,\n",
       " -0.010630499571561813,\n",
       " 0.026747707277536392,\n",
       " -0.011945023201406002,\n",
       " 0.02324230968952179,\n",
       " -0.0017939761746674776,\n",
       " 0.026138072833418846,\n",
       " 0.019203482195734978,\n",
       " -0.011417943984270096,\n",
       " 0.0015717135975137353,\n",
       " -0.0019432095577940345,\n",
       " -0.0012994420249015093,\n",
       " -0.016523631289601326,\n",
       " 0.007233057636767626,\n",
       " -0.01630771905183792,\n",
       " -0.021108590066432953,\n",
       " 0.012014877051115036,\n",
       " 0.02913544327020645,\n",
       " 0.017628593370318413,\n",
       " 0.017793703824281693,\n",
       " 0.005058059934526682,\n",
       " 0.0028274969663470984,\n",
       " -0.011386191472411156,\n",
       " 0.004121382255107164,\n",
       " -0.028093984350562096,\n",
       " 0.018644651398062706,\n",
       " 0.011284586042165756,\n",
       " 0.01766669563949108,\n",
       " 0.006483715493232012,\n",
       " 0.0007441825582645833,\n",
       " 0.012853124178946018,\n",
       " 0.004657987505197525,\n",
       " -0.030151499435305595,\n",
       " -0.002559194341301918,\n",
       " 0.007341013755649328,\n",
       " 0.02606186829507351,\n",
       " -0.016231514513492584,\n",
       " 0.008382472209632397,\n",
       " 0.01407239306718111,\n",
       " -0.019520999863743782,\n",
       " 0.006042365450412035,\n",
       " -0.007461670786142349,\n",
       " 0.013005533255636692,\n",
       " 0.03627324476838112,\n",
       " -0.022670777514576912,\n",
       " -0.007677583023905754,\n",
       " -0.6831969022750854,\n",
       " -0.025109315291047096,\n",
       " 0.010503492318093777,\n",
       " -0.006442438345402479,\n",
       " 0.03495236858725548,\n",
       " 0.040896303951740265,\n",
       " 0.010420937091112137,\n",
       " -0.0018987570656463504,\n",
       " -0.007766488008201122,\n",
       " -0.0025893584825098515,\n",
       " 0.0013462759088724852,\n",
       " -0.0006548806559294462,\n",
       " 0.020867276936769485,\n",
       " 0.00921436958014965,\n",
       " -0.016599835827946663,\n",
       " -0.022924792021512985,\n",
       " -0.00770933460444212,\n",
       " -0.01498684473335743,\n",
       " -0.017095163464546204,\n",
       " 0.016320420429110527,\n",
       " -0.021642019972205162,\n",
       " -0.005832803901284933,\n",
       " -0.02075297012925148,\n",
       " -0.026138072833418846,\n",
       " 0.0023401069920510054,\n",
       " 0.017412681132555008,\n",
       " 0.026798510923981667,\n",
       " -0.006940941326320171,\n",
       " -0.010135171003639698,\n",
       " 0.01760319247841835,\n",
       " -0.017463484779000282,\n",
       " -0.003537149401381612,\n",
       " 0.004912002012133598,\n",
       " 0.013551663607358932,\n",
       " 0.03010069765150547,\n",
       " 0.0003953097912017256,\n",
       " -0.03576521575450897,\n",
       " 0.005689920857548714,\n",
       " 0.01231334451586008,\n",
       " 0.019584504887461662,\n",
       " -0.01935589127242565,\n",
       " 0.0004171391483396292,\n",
       " 0.01314524095505476,\n",
       " -0.026569897308945656,\n",
       " -0.03309806436300278,\n",
       " -0.012014877051115036,\n",
       " 0.012440350838005543,\n",
       " -0.0042007616721093655,\n",
       " 0.017793703824281693,\n",
       " -0.02250566892325878,\n",
       " 0.006074117496609688,\n",
       " 0.011221082881093025,\n",
       " 0.011227432638406754,\n",
       " 0.004943753592669964,\n",
       " 0.002060691127553582,\n",
       " -0.00557878939434886,\n",
       " 0.03076113387942314,\n",
       " 0.007055247668176889,\n",
       " 0.005499409977346659,\n",
       " 0.006972692906856537,\n",
       " -0.02944025956094265,\n",
       " 0.0167776457965374,\n",
       " -0.031015148386359215,\n",
       " -0.007455320097506046,\n",
       " -0.019940124824643135,\n",
       " 0.005426380783319473,\n",
       " -0.004242039285600185,\n",
       " 0.017984213307499886,\n",
       " 0.023051800206303596,\n",
       " -0.021629318594932556,\n",
       " 0.009684296324849129,\n",
       " 0.00906831119209528,\n",
       " -0.007214006502181292,\n",
       " 0.0020479904487729073,\n",
       " -0.012491154484450817,\n",
       " 0.01037648506462574,\n",
       " -0.0004286491603124887,\n",
       " -0.011024221777915955,\n",
       " -0.017196768894791603,\n",
       " 0.01125283446162939,\n",
       " -0.003318062052130699,\n",
       " -0.011748162098228931,\n",
       " 0.00896670576184988,\n",
       " -0.01357706543058157,\n",
       " 0.028271794319152832,\n",
       " -0.013284948654472828,\n",
       " -0.03030390851199627,\n",
       " -0.004530980251729488,\n",
       " 0.006048716139048338,\n",
       " 8.518409595126286e-05,\n",
       " 0.019444795325398445,\n",
       " 0.0021718223579227924,\n",
       " -0.002006713068112731,\n",
       " -0.014313707128167152,\n",
       " -0.023432821035385132,\n",
       " 0.001811439637094736,\n",
       " -0.02964347042143345,\n",
       " 0.0016399798914790154,\n",
       " -0.000679091433994472,\n",
       " 0.005639117676764727,\n",
       " 0.003524448722600937,\n",
       " 0.01299283280968666,\n",
       " 0.01690465211868286,\n",
       " 0.006705977953970432,\n",
       " 0.025236323475837708,\n",
       " 0.03007529489696026,\n",
       " -0.008661888539791107,\n",
       " 0.011182980611920357,\n",
       " 0.025782452896237373,\n",
       " -0.041353531181812286,\n",
       " 0.009081011638045311,\n",
       " -0.010903564281761646,\n",
       " -0.01279597170650959,\n",
       " 0.008731742389500141,\n",
       " 0.007258458994328976,\n",
       " -0.020295744761824608,\n",
       " 0.01455502025783062,\n",
       " -0.012580059468746185,\n",
       " 0.0052612717263400555,\n",
       " -0.01723487116396427,\n",
       " 0.04109951853752136,\n",
       " 0.003091036807745695,\n",
       " 0.020829174667596817,\n",
       " 0.014440714381635189,\n",
       " -0.017260273918509483,\n",
       " 0.0025861833710223436,\n",
       " -0.013348452746868134,\n",
       " -0.014809034764766693,\n",
       " -0.025401432067155838,\n",
       " 0.007588677573949099,\n",
       " 0.008757143281400204,\n",
       " -0.0002462748088873923,\n",
       " -0.0039403969421982765,\n",
       " 0.004032477270811796,\n",
       " 0.01982581801712513,\n",
       " 0.000611618859693408,\n",
       " -0.00800780113786459,\n",
       " 4.09796521125827e-05,\n",
       " 0.005794701632112265,\n",
       " -0.014377210289239883,\n",
       " -0.014301005750894547,\n",
       " 0.007747436873614788,\n",
       " -0.006118569988757372,\n",
       " -0.0029179893899708986,\n",
       " -0.009817653335630894,\n",
       " -0.008877800777554512,\n",
       " -0.02867821604013443,\n",
       " -0.01955910213291645,\n",
       " 0.00407692976295948,\n",
       " 0.005391453858464956,\n",
       " -0.018644651398062706,\n",
       " -0.003289485350251198,\n",
       " 0.004172184970229864,\n",
       " 0.0028719494584947824,\n",
       " 0.01193232275545597,\n",
       " -0.008064954541623592,\n",
       " -0.010433638468384743,\n",
       " -0.013907283544540405,\n",
       " -0.007766488008201122,\n",
       " 0.004153134301304817,\n",
       " 0.0002960854326374829,\n",
       " 0.04064229130744934,\n",
       " -0.00487389974296093,\n",
       " -0.004137258045375347,\n",
       " -0.017844505608081818,\n",
       " -0.023559827357530594,\n",
       " -0.002389322267845273,\n",
       " 0.010382835753262043,\n",
       " -0.020879976451396942,\n",
       " -0.02433457225561142,\n",
       " -0.0025020409375429153,\n",
       " -0.011373491026461124,\n",
       " 0.011608454398810863,\n",
       " -0.01694275438785553,\n",
       " -0.010789258405566216,\n",
       " 0.014186699874699116,\n",
       " -0.021197494119405746,\n",
       " 0.0005044565768912435,\n",
       " -0.004257915075868368,\n",
       " -0.020867276936769485,\n",
       " 0.010052616707980633,\n",
       " 0.0018098520813509822,\n",
       " 0.009385828860104084,\n",
       " -0.0005044565768912435,\n",
       " 0.016155309975147247,\n",
       " 0.02095618098974228,\n",
       " 0.003340288298204541,\n",
       " 0.04432549700140953,\n",
       " -0.007988750003278255,\n",
       " 0.007194955367594957,\n",
       " -0.0084396256133914,\n",
       " 0.01770479790866375,\n",
       " -0.001974961254745722,\n",
       " -0.001337544177658856,\n",
       " -0.02791617438197136,\n",
       " -0.004273790866136551,\n",
       " -0.016917353495955467,\n",
       " -0.0006751224282197654,\n",
       " 0.003841966623440385,\n",
       " 0.025668146088719368,\n",
       " 0.011995825916528702,\n",
       " -0.004346820060163736,\n",
       " 0.012345096096396446,\n",
       " -0.0033847407903522253,\n",
       " 0.008547581732273102,\n",
       " -0.032971058040857315,\n",
       " 0.002708427608013153,\n",
       " -0.002937040524557233,\n",
       " 0.005629592575132847,\n",
       " 0.02954186499118805,\n",
       " 0.008166559971868992,\n",
       " -0.001960673136636615,\n",
       " -0.0037816381081938744,\n",
       " 0.00654721911996603,\n",
       " 0.004946928936988115,\n",
       " 0.00941758044064045,\n",
       " 0.00274335453286767,\n",
       " 0.012002176605165005,\n",
       " 0.010103419423103333,\n",
       " -0.021108590066432953,\n",
       " -0.01299283280968666,\n",
       " 0.009925609454512596,\n",
       " 0.017514286562800407,\n",
       " -0.007671232335269451,\n",
       " -0.024093257263302803,\n",
       " 0.015545676462352276,\n",
       " 0.018543045967817307,\n",
       " 0.03398711606860161,\n",
       " 0.0006187629769556224,\n",
       " -0.040362875908613205,\n",
       " -0.0060106138698756695,\n",
       " -0.014821735210716724,\n",
       " 0.010236777365207672,\n",
       " 0.01595209911465645,\n",
       " -0.010935316793620586,\n",
       " 0.015190056525170803,\n",
       " 0.0027719312347471714,\n",
       " -0.01607910729944706,\n",
       " 0.030278507620096207,\n",
       " 0.00725210877135396,\n",
       " -0.004826271906495094,\n",
       " 0.016523631289601326,\n",
       " 0.01750158704817295,\n",
       " -0.005327950231730938,\n",
       " 0.019051073119044304,\n",
       " 0.006197949405759573,\n",
       " 0.031675584614276886,\n",
       " 0.004832622595131397,\n",
       " -0.01445341482758522,\n",
       " 0.014859837479889393,\n",
       " 0.0034863464534282684,\n",
       " -0.01618071272969246,\n",
       " -0.013513561338186264,\n",
       " 0.002956091659143567,\n",
       " 0.0021146691869944334,\n",
       " -0.022950192913413048,\n",
       " 0.009735099039971828,\n",
       " 0.034063320606946945,\n",
       " 0.025807855650782585,\n",
       " 0.030710332095623016,\n",
       " 0.020803771913051605,\n",
       " 0.005400979425758123,\n",
       " 0.0003105721843894571,\n",
       " -0.01129093673080206,\n",
       " 0.005642293021082878,\n",
       " 0.018352534621953964,\n",
       " -0.014809034764766693,\n",
       " -0.013538963161408901,\n",
       " -0.014301005750894547,\n",
       " 0.0039118207059800625,\n",
       " -0.008928603492677212,\n",
       " -0.002471876796334982,\n",
       " 0.0051056877709925175,\n",
       " 0.009004808031022549,\n",
       " 0.005089811980724335,\n",
       " 0.003997550345957279,\n",
       " 0.01319604367017746,\n",
       " 0.008026852272450924,\n",
       " -0.00016034653526730835,\n",
       " 0.00628367904573679,\n",
       " -0.0204862542450428,\n",
       " -0.026442890986800194,\n",
       " -0.011697359383106232,\n",
       " 0.01955910213291645,\n",
       " -0.00039272994035854936,\n",
       " 0.006388460285961628,\n",
       " -0.03347908705472946,\n",
       " 0.009481084533035755,\n",
       " 0.0011470334138721228,\n",
       " 0.028957633301615715,\n",
       " -0.002525854855775833,\n",
       " 0.024842601269483566,\n",
       " 0.007233057636767626,\n",
       " 0.01601560227572918,\n",
       " 0.01347546000033617,\n",
       " -0.0016479179030284286,\n",
       " 0.01450421754270792,\n",
       " -0.004410323686897755,\n",
       " 0.0005207293434068561,\n",
       " -0.004883425310254097,\n",
       " -0.00896670576184988,\n",
       " -0.008858749642968178,\n",
       " 0.00785539299249649,\n",
       " 0.011316337622702122,\n",
       " 0.019051073119044304,\n",
       " -0.006347182672470808,\n",
       " 0.004384922329336405,\n",
       " -0.024080557748675346,\n",
       " 0.016764944419264793,\n",
       " 0.005115213338285685,\n",
       " -0.018390636891126633,\n",
       " -0.004315068479627371,\n",
       " 0.006188423838466406,\n",
       " -0.034926969558000565,\n",
       " 0.003899119794368744,\n",
       " 0.016650639474391937,\n",
       " -0.00911911390721798,\n",
       " 0.01097341813147068,\n",
       " 0.03627324476838112,\n",
       " 0.01004626601934433,\n",
       " 0.008122107945382595,\n",
       " -0.012834073044359684,\n",
       " -0.012326044961810112,\n",
       " 0.021133990958333015,\n",
       " 0.057204023003578186,\n",
       " 0.022023040801286697,\n",
       " -0.009347726590931416,\n",
       " -0.00022027804516255856,\n",
       " -0.008033202961087227,\n",
       " 0.009373128414154053,\n",
       " -0.030278507620096207,\n",
       " 0.02291209250688553,\n",
       " 0.01720947027206421,\n",
       " -0.0034736457746475935,\n",
       " -0.00614079600200057,\n",
       " 0.010084368288516998,\n",
       " 0.021730925887823105,\n",
       " 0.001803501625545323,\n",
       " 0.028220990672707558,\n",
       " -0.011417943984270096,\n",
       " -0.00029549008468165994,\n",
       " 0.0037467111833393574,\n",
       " -0.008782545104622841,\n",
       " -0.004172184970229864,\n",
       " -0.000781490933150053,\n",
       " -0.002343282103538513,\n",
       " 0.009455682709813118,\n",
       " 3.860447122860933e-06,\n",
       " -0.01266261376440525,\n",
       " 0.00825546495616436,\n",
       " 0.023724937811493874,\n",
       " 0.005689920857548714,\n",
       " 0.0009835116798058152,\n",
       " -0.015050348825752735,\n",
       " 0.0019130453001707792,\n",
       " -0.00023297875304706395,\n",
       " -0.01309443823993206,\n",
       " -0.014694727957248688,\n",
       " -0.00019785334006883204,\n",
       " 0.011062324047088623,\n",
       " 0.003673681989312172,\n",
       " 0.005416855216026306,\n",
       " -0.0015431370120495558,\n",
       " 0.0203846488147974,\n",
       " 0.010776557959616184,\n",
       " 0.0031116753816604614,\n",
       " 0.0017622243613004684,\n",
       " -0.010770207270979881,\n",
       " 0.006185248494148254,\n",
       " 0.0035180982667952776,\n",
       " -0.019584504887461662,\n",
       " 0.009766850620508194,\n",
       " -0.007023496087640524,\n",
       " -0.019863920286297798,\n",
       " 0.011646556667983532,\n",
       " -0.008122107945382595,\n",
       " -0.0037689374294131994,\n",
       " -0.00226707779802382,\n",
       " 0.01753968931734562,\n",
       " 0.018390636891126633,\n",
       " -0.011494147591292858,\n",
       " -0.00652181776240468,\n",
       " -0.010262178257107735,\n",
       " -0.04021046683192253,\n",
       " -0.012776920571923256,\n",
       " -0.009144515730440617,\n",
       " -0.018949467688798904,\n",
       " 0.004378571640700102,\n",
       " -0.0017622243613004684,\n",
       " -0.006686926819384098,\n",
       " -0.004515104461461306,\n",
       " -0.02758595533668995,\n",
       " -0.007239408325403929,\n",
       " 0.011614805087447166,\n",
       " -0.0007124308031052351,\n",
       " -0.0028259092941880226,\n",
       " -0.01574888825416565,\n",
       " -0.0067948829382658005,\n",
       " 0.018746256828308105,\n",
       " 0.019863920286297798,\n",
       " 0.00896670576184988,\n",
       " -0.013704072684049606,\n",
       " 0.0052612717263400555,\n",
       " 0.0387117825448513,\n",
       " 0.014974144287407398,\n",
       " -0.03251383453607559,\n",
       " -0.0004556381900329143,\n",
       " 0.007861742749810219,\n",
       " -0.00848407857120037,\n",
       " 0.004889775533229113,\n",
       " 0.013424656353890896,\n",
       " -0.0009922434110194445,\n",
       " 0.0024972783867269754,\n",
       " -0.008147508837282658,\n",
       " 0.02738274447619915,\n",
       " 0.004311893135309219,\n",
       " 0.014491517096757889,\n",
       " 0.0012502267491072416,\n",
       " -0.0233693178743124,\n",
       " -0.00730291148647666,\n",
       " 0.01357706543058157,\n",
       " 0.006026489660143852,\n",
       " -0.021832531318068504,\n",
       " -0.007556925993412733,\n",
       " 0.010719404555857182,\n",
       " -0.012834073044359684,\n",
       " -0.007245758548378944,\n",
       " -0.014135897159576416,\n",
       " 0.023280411958694458,\n",
       " -0.00730291148647666,\n",
       " 0.018682753667235374,\n",
       " 0.007487072143703699,\n",
       " -0.034393537789583206,\n",
       " 0.014034290798008442,\n",
       " 0.010522543452680111,\n",
       " 0.008852398954331875,\n",
       " 0.0027116029523313046,\n",
       " 0.006515467073768377,\n",
       " 0.023623332381248474,\n",
       " 0.024817198514938354,\n",
       " -0.008338020183146,\n",
       " -0.011544951237738132,\n",
       " -0.026315882802009583,\n",
       " -0.013056335970759392,\n",
       " -0.017679397016763687,\n",
       " -0.024372674524784088,\n",
       " 0.01193232275545597,\n",
       " 0.015532976016402245,\n",
       " 0.004832622595131397,\n",
       " 0.025947563350200653,\n",
       " -0.016231514513492584,\n",
       " -0.02496960759162903,\n",
       " -0.019279686734080315,\n",
       " 0.014301005750894547,\n",
       " 0.004296017345041037,\n",
       " -0.011144878342747688,\n",
       " -0.014377210289239883,\n",
       " -0.01700625941157341,\n",
       " -0.019940124824643135,\n",
       " -0.0012597523164004087,\n",
       " -1.0356540769862477e-05,\n",
       " 0.03137077018618584,\n",
       " 0.016320420429110527,\n",
       " -0.02944025956094265,\n",
       " -0.01856844685971737,\n",
       " 0.034164924174547195,\n",
       " 0.015012246556580067,\n",
       " -0.011729110963642597,\n",
       " -0.046230606734752655,\n",
       " -0.03040551394224167,\n",
       " 0.004397622775286436,\n",
       " 0.006375759374350309,\n",
       " -0.007118751294910908,\n",
       " 0.010268528945744038,\n",
       " 0.0037181347142904997,\n",
       " -0.0004861992783844471,\n",
       " -0.00901750847697258,\n",
       " -0.003546674968674779,\n",
       " 5.181371307116933e-06,\n",
       " -0.019965525716543198,\n",
       " -0.034723758697509766,\n",
       " 0.022073844447731972,\n",
       " 0.044935133308172226,\n",
       " 0.01284677442163229,\n",
       " 0.01221808884292841,\n",
       " 0.012376847676932812,\n",
       " 0.026671502739191055,\n",
       " 0.013780277222394943,\n",
       " -0.019381292164325714,\n",
       " -0.006382109597325325,\n",
       " 0.022404063493013382,\n",
       " -0.015507574193179607,\n",
       " -0.010205024853348732,\n",
       " 0.018606549128890038,\n",
       " 0.022962894290685654,\n",
       " 0.015901295468211174,\n",
       " 0.017387280240654945,\n",
       " 0.01935589127242565,\n",
       " -0.0024639389012008905,\n",
       " 0.012262540869414806,\n",
       " 0.007912546396255493,\n",
       " 0.0004770706291310489,\n",
       " -0.026976320892572403,\n",
       " -0.008928603492677212,\n",
       " -0.007556925993412733,\n",
       " -0.0215150136500597,\n",
       " -0.013538963161408901,\n",
       " -0.0048866006545722485,\n",
       " 0.015964800491929054,\n",
       " -0.022632675245404243,\n",
       " 0.003914995584636927,\n",
       " 0.004156309179961681,\n",
       " 0.002617935184389353,\n",
       " -0.007614079397171736,\n",
       " 0.0393214151263237,\n",
       " -0.011595753952860832,\n",
       " 0.03942302241921425,\n",
       " 0.02519822120666504,\n",
       " 0.009258821606636047,\n",
       " -0.03302185982465744,\n",
       " -0.019648008048534393,\n",
       " 0.01023042667657137,\n",
       " -0.012541957199573517,\n",
       " 0.009106413461267948,\n",
       " -0.008655537851154804,\n",
       " 0.00848407857120037,\n",
       " -0.021438809111714363,\n",
       " -0.023661434650421143,\n",
       " 0.00896670576184988,\n",
       " 0.024194864556193352,\n",
       " -0.020041730254888535,\n",
       " -0.012510205619037151,\n",
       " 0.009100062772631645,\n",
       " -0.02472829446196556,\n",
       " -0.005956635810434818,\n",
       " -0.03594302758574486,\n",
       " -0.027204934507608414,\n",
       " -0.01587589457631111,\n",
       " 0.01803501695394516,\n",
       " 0.028754420578479767,\n",
       " -0.02231515757739544,\n",
       " 0.01628231815993786,\n",
       " -0.008973055519163609,\n",
       " -0.03126916289329529,\n",
       " -0.0005425587296485901,\n",
       " 0.04051528498530388,\n",
       " 0.033860109746456146,\n",
       " -0.011392542161047459,\n",
       " 0.04691644385457039,\n",
       " -0.003581601893529296,\n",
       " -0.0032434454187750816,\n",
       " -0.030253104865550995,\n",
       " 0.018492242321372032,\n",
       " -0.009652543812990189,\n",
       " -0.001245463965460658,\n",
       " 0.01723487116396427,\n",
       " 0.006344007793813944,\n",
       " 0.006801233626902103,\n",
       " 0.0021257824264466763,\n",
       " -0.006001088302582502,\n",
       " 0.013170642778277397,\n",
       " 0.001857479684986174,\n",
       " -0.01651092991232872,\n",
       " 0.004378571640700102,\n",
       " 0.02641749009490013,\n",
       " 0.0067250290885567665,\n",
       " -0.01564728282392025,\n",
       " -0.021235596388578415,\n",
       " -0.017730198800563812,\n",
       " 0.028398800641298294,\n",
       " -0.005982037167996168,\n",
       " -0.00911911390721798,\n",
       " -0.00581692811101675,\n",
       " -0.030913542956113815,\n",
       " -0.02503311075270176,\n",
       " 0.004191236104816198,\n",
       " -0.019902022555470467,\n",
       " 0.008954004384577274,\n",
       " 0.007074298802763224,\n",
       " -0.02035924792289734,\n",
       " 0.011894220486283302,\n",
       " -0.011335388757288456,\n",
       " -0.017120564356446266,\n",
       " -0.009100062772631645,\n",
       " 0.0045563820749521255,\n",
       " -0.00013236526865512133,\n",
       " -0.01727297343313694,\n",
       " 0.026265081018209457,\n",
       " -0.014961443841457367,\n",
       " -0.01856844685971737,\n",
       " -0.005067585501819849,\n",
       " 0.010751156136393547,\n",
       " 0.009754150174558163,\n",
       " 0.024309169501066208,\n",
       " -0.012186337262392044,\n",
       " -0.014656626619398594,\n",
       " -0.03131996467709541,\n",
       " 0.02211194671690464,\n",
       " 0.010605097748339176,\n",
       " -0.017412681132555008,\n",
       " -0.0027401794213801622,\n",
       " -0.006277328822761774,\n",
       " -0.015621881000697613,\n",
       " -0.013551663607358932,\n",
       " 0.018314432352781296,\n",
       " 0.004654812626540661,\n",
       " -0.026646101847290993,\n",
       " -0.0016169599257409573,\n",
       " -0.005159665830433369,\n",
       " -0.013602467253804207,\n",
       " -0.024283768609166145,\n",
       " 0.006902839057147503,\n",
       " -0.01246575266122818,\n",
       " -0.006744080223143101,\n",
       " -0.02283588796854019,\n",
       " -8.339805935975164e-05,\n",
       " -0.0010501904180273414,\n",
       " 0.015926698222756386,\n",
       " 0.014618524350225925,\n",
       " -0.01614261046051979,\n",
       " -0.007423568516969681,\n",
       " 0.019406694918870926,\n",
       " -0.03086273930966854,\n",
       " 0.004172184970229864,\n",
       " 0.010935316793620586,\n",
       " 0.0031180258374661207,\n",
       " -0.012275242246687412,\n",
       " 0.007315612398087978,\n",
       " 0.020079832524061203,\n",
       " -0.019241584464907646,\n",
       " 0.018543045967817307,\n",
       " -0.016523631289601326,\n",
       " -0.011360790580511093,\n",
       " -0.0450875423848629,\n",
       " 0.005613716319203377,\n",
       " 0.007023496087640524,\n",
       " -0.012757869437336922,\n",
       " 0.011678308248519897,\n",
       " 0.003059284994378686,\n",
       " 0.003899119794368744,\n",
       " 0.010446338914334774,\n",
       " 0.0069155399687588215,\n",
       " -0.009303274564445019,\n",
       " -0.006217000540345907,\n",
       " -0.018250929191708565,\n",
       " 0.0007961761439219117,\n",
       " 0.020244941115379333,\n",
       " -0.002003537956625223,\n",
       " -0.008134808391332626,\n",
       " -0.00936677772551775,\n",
       " 0.0055597382597625256,\n",
       " -0.006105869077146053,\n",
       " -0.028322596102952957,\n",
       " -0.030049894005060196,\n",
       " -0.01601560227572918,\n",
       " 0.02900843508541584,\n",
       " -0.010928966104984283,\n",
       " 0.004530980251729488,\n",
       " -0.027001721784472466,\n",
       " 0.003918170928955078,\n",
       " -0.011773563921451569,\n",
       " -0.009569989517331123,\n",
       " -0.020067131146788597,\n",
       " -0.001959085464477539,\n",
       " -0.009766850620508194,\n",
       " 0.014974144287407398,\n",
       " 0.006363058928400278,\n",
       " 0.0016463303472846746,\n",
       " -0.01661253720521927,\n",
       " -0.005610541440546513,\n",
       " -0.009093713015317917,\n",
       " -0.021603917703032494,\n",
       " -0.039169009774923325,\n",
       " -0.019673408940434456,\n",
       " -0.004480177536606789,\n",
       " 0.020067131146788597,\n",
       " 0.011456046253442764,\n",
       " -0.024448879063129425,\n",
       " -0.027509750798344612,\n",
       " -0.0031085002701729536,\n",
       " -0.0415821447968483,\n",
       " -0.030710332095623016,\n",
       " -0.007493422366678715,\n",
       " 0.0060106138698756695,\n",
       " -0.00768393324688077,\n",
       " 0.011284586042165756,\n",
       " 0.00242424919269979,\n",
       " 0.006442438345402479,\n",
       " 0.005315249785780907,\n",
       " 0.016383923590183258,\n",
       " -0.04485892876982689,\n",
       " -0.015761587768793106,\n",
       " 0.017882607877254486,\n",
       " -0.017679397016763687,\n",
       " 0.018479540944099426,\n",
       " -0.014097794890403748,\n",
       " 0.006712328176945448,\n",
       " -0.030583323910832405,\n",
       " 0.006486890837550163,\n",
       " 0.012072030454874039,\n",
       " 0.008903201669454575,\n",
       " 0.0051056877709925175,\n",
       " 0.009766850620508194,\n",
       " -0.016625236719846725,\n",
       " -0.014682027511298656,\n",
       " 0.013945385813713074,\n",
       " 0.019686110317707062,\n",
       " 0.010071667842566967,\n",
       " 0.006051891017705202,\n",
       " -0.019368592649698257,\n",
       " -0.008630136959254742,\n",
       " -0.017958812415599823,\n",
       " 0.018441438674926758,\n",
       " -0.01634582132101059,\n",
       " 0.009544587694108486,\n",
       " 0.012573708780109882,\n",
       " -0.004403973463922739,\n",
       " 0.011824366636574268,\n",
       " 0.0034609450958669186,\n",
       " 0.002575070131570101,\n",
       " 0.0012216501636430621,\n",
       " -0.026595300063490868,\n",
       " -0.020511656999588013,\n",
       " -0.00784269254654646,\n",
       " -0.010287580080330372,\n",
       " 0.0017066587461158633,\n",
       " -0.020740268751978874,\n",
       " -0.038508571684360504,\n",
       " -0.014948742464184761,\n",
       " 0.002379796700552106,\n",
       " -0.03259003534913063,\n",
       " -0.006769481580704451,\n",
       " 0.0032450328581035137,\n",
       " -0.013538963161408901,\n",
       " 0.0047310166992247105,\n",
       " -0.014974144287407398,\n",
       " 0.021870633587241173,\n",
       " -0.035358794033527374,\n",
       " -0.004489703103899956,\n",
       " 0.0014534381916746497,\n",
       " -0.014301005750894547,\n",
       " -0.03607003390789032,\n",
       " 0.03957543149590492,\n",
       " 0.015393267385661602,\n",
       " -0.01402159035205841,\n",
       " -0.004829447250813246,\n",
       " 0.010281229391694069,\n",
       " 0.009455682709813118,\n",
       " 0.00478181941434741,\n",
       " 0.008077654987573624,\n",
       " 0.012345096096396446,\n",
       " -0.018987569957971573,\n",
       " -0.0098811574280262,\n",
       " 0.008249115198850632,\n",
       " -0.020740268751978874,\n",
       " -0.018974870443344116,\n",
       " -0.003959448076784611,\n",
       " 0.011227432638406754,\n",
       " 0.0058931321837008,\n",
       " 0.0005973305669613183,\n",
       " 0.2194683700799942,\n",
       " 0.009208018891513348,\n",
       " 0.014034290798008442,\n",
       " 0.03802594542503357,\n",
       " -0.005642293021082878,\n",
       " 0.027179531753063202,\n",
       " 0.002584595698863268,\n",
       " -0.01440261211246252,\n",
       " -0.010890863835811615,\n",
       " 0.011132177896797657,\n",
       " 0.004378571640700102,\n",
       " 0.0031100877095013857,\n",
       " -0.020346546545624733,\n",
       " 0.008560282178223133,\n",
       " 0.002514741849154234,\n",
       " -0.017781002447009087,\n",
       " -0.030278507620096207,\n",
       " -0.0011271885596215725,\n",
       " -0.016295017674565315,\n",
       " -0.010503492318093777,\n",
       " 0.007722035516053438,\n",
       " -0.042217180132865906,\n",
       " 0.00916356686502695,\n",
       " -0.003543499857187271,\n",
       " 0.02046085335314274,\n",
       " -0.024982308968901634,\n",
       " -0.03975323960185051,\n",
       " 0.007410867605358362,\n",
       " 0.009227070026099682,\n",
       " 0.01407239306718111,\n",
       " -0.001632041996344924,\n",
       " -0.015190056525170803,\n",
       " 0.016028303653001785,\n",
       " -0.00048421480460092425,\n",
       " -0.009874806739389896,\n",
       " -0.008306268602609634,\n",
       " 0.0024178987368941307,\n",
       " 0.002868774114176631,\n",
       " 0.032539233565330505,\n",
       " 0.023267712444067,\n",
       " 0.0010287580080330372,\n",
       " 0.004638936370611191,\n",
       " 0.01223078928887844,\n",
       " -0.004858023952692747,\n",
       " -0.004419849254190922,\n",
       " 0.013767575845122337,\n",
       " ...]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from langchain.embeddings import OpenAIEmbeddings\n",
    "\n",
    "embeddings = OpenAIEmbeddings(openai_api_key = \"\")\n",
    "res = embeddings.embed_query(\"This is an apple.\")\n",
    "res\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
